package miku.firstgame.net.pack
{
	import flash.utils.ByteArray;
	
	import miku.firstgame.constrants.ProtocalConstants;
	import miku.firstgame.net.ByteArrayEx;

	public class EnterRoomRequestPack extends AbstractRequestPack
	{
		public var roomId:int;
		
		public function EnterRoomRequestPack()
		{
			super();
		}
		
		override public function encode():ByteArray
		{
			var data:ByteArrayEx = new ByteArrayEx();
			data.writeUnsignedInt(8);
			data.writeShort(tag);
			data.writeShort(0);
			
			data.writeUnsignedInt(roomId);
			data.position = 0;
			return data;
		}
		
		override public function get tag():int
		{
			return ProtocalConstants.ENTER_ROOM;
		}
	}
}